import Vue from 'vue';


import Cookies from 'js-cookie';

import 'normalize.css/normalize.css';

import 'bootstrap/dist/css/bootstrap.min.css';
import 'bootstrap/dist/js/bootstrap.min.js';
import global from './components/Global';

import ElementUI from 'element-ui';

import 'element-ui/lib/theme-chalk/index.css';

import '@/styles/index.scss'; 
import '@static/iconfont/iconfont.css';

import App from './App';
import router from './router';
import store from './store';
import getters from './store/getters';


import i18n from './lang'; 
import '@/icons'; 
import '@/permission'; 
import shared from './shared';
import $ from 'jquery';
import moment from 'moment';

import VueClipboard from 'vue-clipboard2';
Vue.use(VueClipboard);

//对话框移动指令
import elDragDialog from './directive/drag_dialog/index';
Vue.use(elDragDialog);

//图片轮播
import 'swiper/dist/css/swiper.min.css';
import VueAwesomeSwiper from 'vue-awesome-swiper';
Vue.use(VueAwesomeSwiper); //记得不要忘记这句

//多选-级联选择器
import cascaderMulti from 'cascader-multi'; 
Vue.use(cascaderMulti);

//图片懒加载
import Vuelazyload from 'vue-lazyload';
Vue.use(Vuelazyload,{
  loading:require('./assets/image/default.png') //src\assets\image\default.png
});

//图片放大缩小预览
import Viewer from 'v-viewer';
import 'viewerjs/dist/viewer.css';
Vue.use(Viewer);
Viewer.setDefaults({
  options:{'inline':true,'button': true, 'navbar': false, 'title': true, 'toolbar': true, 'tooltip': true, 'movable': true, 'zoomable': true, 'rotatable': true, 'scalable': true, 'transition': true, 'fullscreen': true, 'keyboard': true}//, 'url': 'data-source'
});

Vue.use(ElementUI, {
  size: Cookies.get('size') || 'medium', // set element-ui default size
  i18n: (key, value) => i18n.t(key, value)
});

Vue.config.productionTip = false;
Vue.prototype.$Shared = shared;
Vue.prototype.$Global = global;
Vue.prototype.$Moment = moment;

var _hmt = _hmt || [];
window._hmt = _hmt; // 必须把_hmt挂载到window下，否则找不到

Vue.filter('striphtml', function (value) {
  var div = document.createElement('div');
  div.innerHTML = value;
  var text = div.textContent || div.innerText || '';
  return text;
});

new Vue({
  el: '#app',
  router,
  store,
  i18n,
  template: '<App/>',
  components: { App },
  $,  
});
